<template>
  <div id="app">
    <div class="header1">
      <router-link to="/login" class="login1">登录</router-link>
      <h1>超市管理系统</h1>
      <el-button round type="warning" v-on:click="unLogin" class="unLogin1">退出登录</el-button>
    </div>
    <el-main>
      <router-view/>
    </el-main>
  </div>
</template>

<script>
export default {
  name: 'App',
  data () {
    return {
      activeIndex: '1',
      msg: ''
    }
  },
  methods: {
    unLogin () {
      this.axios.get('http://localhost:8989/unLogin').then(res => {
        this.msg = res.data
        console.log(this.msg = res.data)
        this.$router.push('/index')
      })
      alert(this.msg)
    }
  }
}
</script>

<style>
#app {

}
.login1{
  font-size: 25px;
  margin-left: 90%;
  text-decoration: none;
}
.unLogin1{
  font-size: 15px;
  margin-left: 90%;
}
.header1{
  background-color: #7fbdff;
}
.header1 h1{
  font-size: 35px;
  text-align: center;
}
</style>
